﻿using PivotCollectionTools.Xml;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.ObjectModel;

namespace PivotCollectionTools.Xml.Test
{
    
    
    /// <summary>
    ///This is a test class for ItemTest and is intended
    ///to contain all ItemTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ItemTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Tags
        ///</summary>
        [TestMethod()]
        public void Item_Tags_Test()
        {
            Item target = new Item();
            target.Tags.Add(new Tag());

            Collection<Tag> actual;
            actual = target.Tags;

            Assert.AreEqual(1, actual.Count);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void Item_Name_Test()
        {
            Item target = new Item();
            string expected = "nameTest";
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Image
        ///</summary>
        [TestMethod()]
        public void Item_Image_Test()
        {
            Item target = new Item();
            string expected = "testImage";
            string actual;
            target.Image = expected;
            actual = target.Image;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Identifier
        ///</summary>
        [TestMethod()]
        public void Item_Identifier_Test()
        {
            Item target = new Item();
            string expected = "testIdentifier";
            string actual;
            target.Identifier = expected;
            actual = target.Identifier;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Href
        ///</summary>
        [TestMethod()]
        public void Item_Href_Test()
        {
            Item target = new Item();
            string expected = "hrefTest";
            string actual;
            target.Href = expected;
            actual = target.Href;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Facets
        ///</summary>
        [TestMethod()]
        public void Item_Facets_Test()
        {
            Item target = new Item();
            target.Facets.AddTextFacet("test", "test");
            FacetCollection actual;
            actual = target.Facets;

            Assert.AreEqual(1, actual.Count);
        }

        /// <summary>
        ///A test for Description
        ///</summary>
        [TestMethod()]
        public void Item_Description_Test()
        {
            Item target = new Item();
            string expected = "testDescription";
            string actual;
            target.Description = expected;
            actual = target.Description;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Item Constructor
        ///</summary>
        [TestMethod()]
        public void Item_Constructor_Test()
        {
            Item target = new Item();
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for Item Constructor
        ///</summary>
        [TestMethod()]
        public void Item_Constructor_Idetifier_Test()
        {
            string identifier = "testIdentifier";
            Item target = new Item(identifier);
            Assert.AreEqual(identifier, target.Identifier);
        }
    }
}
